﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MSpecLauncher.Model;

namespace MSpecLauncher.Services
{
    /// <summary>
    /// According with the configuration, executes the tests and builds a model with the results
    /// </summary>
    public interface ILauncher
    {
        /// <summary>
        /// Event to notify that a new automatic run has completed
        /// </summary>
        event Action AutomaticRunFinished;

        /// <summary>
        /// Gets html file name with specs results
        /// </summary>
        string HTMLFileName { get; }

        /// <summary>
        /// Gets file name with specs results
        /// </summary>
        string ResultFileName { get; }

        /// <summary>
        /// Gets current spec run results
        /// </summary>
        SpecRun SpecRun { get; }

        /// <summary>
        /// Load the given config file.
        /// Exceptions are propagated.
        /// </summary>
        void LoadConfigFile(string configFile);

        /// <summary>
        /// Run the tests and update the model with the results.
        /// Exceptions are propagated.
        /// </summary>
        void Run();

        /// <summary>
        /// Load the given run result file and update the model with its content.
        /// Exceptions are propagated.
        /// </summary>
        void LoadResultFile(string xmlFileName);
    }
}
